package com.mycompany.app.common.audit.access.filter.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

@Entity
@Table(name = "app_logging_message")
public class LoggingMessage {

    private static final long serialVersionUID = -970918961963937595L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    @Column(name = "logging_user")
    private String user;

    private String requestUrl;

    private String remoteIp;

    private String remoteHost;

    private String operation;

    private String userAgent;

    @Column(name = "logging_time")
    private Date logTime;

    public LoggingMessage() {

    }

    // ========================================================

    @Override
    public String toString() {

        return ToStringBuilder.reflectionToString(this,
                ToStringStyle.SHORT_PREFIX_STYLE);
    }

    // ========================================================

    public Long getId() {

        return id;
    }

    public void setId(Long id) {

        this.id = id;
    }

    public String getOperation() {

        return operation;
    }

    public void setOperation(String operation) {

        this.operation = operation;
    }

    public String getRemoteHost() {

        return remoteHost;
    }

    public void setRemoteHost(String remoteHost) {

        this.remoteHost = remoteHost;
    }

    public String getRemoteIp() {

        return remoteIp;
    }

    public void setRemoteIp(String remoteIp) {

        this.remoteIp = remoteIp;
    }

    public String getRequestUrl() {

        return requestUrl;
    }

    public void setRequestUrl(String requestUrl) {

        this.requestUrl = requestUrl;
    }

    public String getUser() {

        return user;
    }

    public void setUser(String user) {

        this.user = user;
    }

    public String getUserAgent() {

        return userAgent;
    }

    public void setUserAgent(String userAgent) {

        this.userAgent = userAgent;
    }

    public Date getLogTime() {

        return logTime;
    }

    public void setLogTime(Date logTime) {

        this.logTime = logTime;
    }
}
